package scatours.client.launcher;

import org.apache.tuscany.sca.Node;
import org.apache.tuscany.sca.TuscanyRuntime;
import org.apache.tuscany.sca.node.ContributionLocationHelper;

import scatours.client.impl.TestClientImpl;

public class TourClientLauncher {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception{
		System.out.println("Starting Client ....");
        String contributionURL = ContributionLocationHelper.getContributionLocation(TestClientImpl.class);
      
        
        TuscanyRuntime runtime= TuscanyRuntime.newInstance();
        Node node = runtime.createNode(TuscanyRuntime.DEFAUL_DOMAIN_NAME);
        
        node.installContribution(contributionURL);
        node.startComposite("introducing-client-distributed","client.composite");
        System.out.println("client.composite ready for big business !!!");
        System.out.println("Press a key to start ...");
        System.in.read();
        Runnable proxy=node.getService(Runnable.class, "TestClient/Runnable");
		proxy.run();
        node.stop();
        System.out.println();

	}

}
